// 检验任务
import { getAction, deleteAction, putAction, putparamsAction, postAction, httpAction } from '@/api/manage'

// 生产检验
const taskProductionInspectionList = (params) =>
  getAction('/jksaas-produce/produce/qualityTask/qualityProduceCheckTask/list', params)
const getCheckPersions = (params) => getAction('/sys/user/queryUserByTenantId', params)
const getBatchList = (params) =>
  getAction('/jksaas-produce/produce/qualityTask/qualityProduceCheckTask/getBatchList', params) // 获取批次
const taskProductionInspectionAdd = (params) =>
  postAction('/jksaas-produce/produce/qualityTask/qualityProduceCheckTask/check', params) // 新增
const getBatchPage = (params) =>
  getAction('/jksaas-produce/produce/qualityTask/qualityProduceCheckTask/getProduceTaskCheckBatchPageList', params) // 获取批次分页
const getCheckOrderPage = (params) =>
  getAction('/jksaas-produce/produce/qualityTask/qualityProduceCheckTask/getProduceTaskCheckRecordPageList', params) // 获取检验单分页

// 来料检验
const incomingInspectionPage = (params) =>
  getAction('/jksaas-produce/produce/materialCheckTask/materialCheckTask/list', params)
const incomingInspectionAdd = (params) =>
  postAction('/jksaas-produce/produce/materialCheckTask/materialCheckTask/add', params)
const incomingInspectionEdit = (params) =>
  putAction('/jksaas-produce/produce/materialCheckTask/materialCheckTask/edit', params)
const incomingInspectionDetail = (params) =>
  getAction('/jksaas-produce/produce/materialCheckTask/materialCheckTask/queryById', params)
const incomingInspectionDel = (params) =>
  deleteAction('/jksaas-produce/produce/materialCheckTask/materialCheckTask/deleteBatch', params)
// 根据生产签收单id获取采购订单列表
const selectPurchaseOrder = (params) =>
  getAction('/jksaas-produce/produce/purchasemgt/erpPurchaseSignOrder/selectPurchaseOrder', params)
// 根据采购订单号获取物品
const selectGoodsByOrder = (params) =>
  getAction('/jksaas-produce/produce/purchasemgt/erpPurchaseSignOrder/selectGoods', params)
//根据物品id查询物品详情
const getGoodsDetailById = (params) =>
  getAction('/jksaas-produce/produce/purchasemgt/erpPurchaseSignOrder/selectGoodDetail', params)
// 检验
const qualityCheckTaskAdd = (params) =>
  postAction('/jksaas-produce/produce/qualityTask/qualityCheckTaskRecord/add', params)
//来料检验下面的检验单
const incomingInspectionChecks = (params) =>
  getAction('/jksaas-produce/produce/qualityTask/qualityCheckTaskRecord/queryPageListDetail', params)
//来料检验-检验人单选
const incomingInspectionCheckUsers = (params) =>
  getAction('/jksaas-produce/produce/materialCheckTask/materialCheckTask/checkByOfId', params)

// 签收单
const signOrderPage = (params) => getAction('/jksaas-produce/produce/purchasemgt/erpPurchaseSignOrder/list', params)

// 检验单-来料检验 && 生产检验
// 来料检验列表
const qualityCheckTaskRecord = (params) =>
  getAction('/jksaas-produce/produce/qualityTask/qualityCheckTaskRecord/list', params)
// 来料检验详情
const queryById = (params) => getAction('/jksaas-produce/produce/qualityTask/qualityCheckTaskRecord/queryById', params)
// 生产检验详情
const listByProduceById = (params) => getAction('/jksaas-produce/produce/checklist/listByProduceById', params)
// 生产检验详情,右侧批次检验
const queryByItem = (params) => getAction('/jksaas-produce/produce/checklist/queryByItem', params)
// 来料检验详情,右侧批次检验
const qualityTaskQueryByItem = (params) =>
  getAction('/jksaas-produce/produce/qualityTask/qualityCheckTaskRecord/queryByItem', params)

// 生产检验列表
const checklist = (params) => getAction('/jksaas-produce/produce/checklist/list', params)
// 生产工序信息列表
const processList = (params) => getAction('/jksaas-produce/produce/baseSetting/process/list', params)
// 质量报表
const produceCheckStatistics = (params) =>
  getAction('/jksaas-produce/produce/checkstatistics/produceCheckStatistics/list', params)
  const getFeedbackSumNum = (params) =>
  postAction('/jksaas-produce/produce/management/statistics/getFeedbackSumNum', params)
const statistics = (params) =>
  getAction('/jksaas-produce/produce/checkstatistics/produceCheckStatistics/statistics', params)

//免检
const materialCheckTaskExemption = (params) =>
  getAction('/jksaas-produce/produce/materialCheckTask/materialCheckTask/exemption', params)
//申请入库
const materialCheckTaskWarehousing = (params) =>
  getAction('/jksaas-produce/produce/materialCheckTask/materialCheckTask/warehousing', params)
// 采购拒收
const materialCheckTaskRejection = (params) =>
  getAction('/jksaas-produce/produce/materialCheckTask/materialCheckTask/rejection', params)
  const managementAnomalousFeedback = (params) =>
  getAction('/jksaas-produce/produce/anomalousfeedback/managementAnomalousFeedback/list', params)
  const getEventDistribution = (params) =>
  postAction('/jksaas-produce/produce/management/statistics/getEventDistribution', params)
  const getReasonDistribution = (params) =>
  postAction('/jksaas-produce/produce/management/statistics/getReasonDistribution', params)
export {
  taskProductionInspectionList,
  getCheckPersions,
  getBatchList,
  taskProductionInspectionAdd,
  getBatchPage,
  getCheckOrderPage,
  incomingInspectionPage,
  incomingInspectionAdd,
  incomingInspectionDetail,
  incomingInspectionDel,
  signOrderPage,
  incomingInspectionEdit,
  qualityCheckTaskAdd,
  incomingInspectionChecks,
  incomingInspectionCheckUsers,
  selectPurchaseOrder,
  selectGoodsByOrder,
  getGoodsDetailById,
  qualityCheckTaskRecord,
  queryById,
  checklist,
  processList,
  listByProduceById,
  queryByItem,
  qualityTaskQueryByItem,
  produceCheckStatistics,
  statistics,
  materialCheckTaskExemption,
  materialCheckTaskWarehousing,
  materialCheckTaskRejection,
  getFeedbackSumNum,
  managementAnomalousFeedback,
  getEventDistribution,
  getReasonDistribution
}
